/*
 * Converter.h
 *
 *  Created on: Oct 28, 2011
 *      Author: Christopher Wood, Max Macri
 *
 *  Convert analog signal from the signal generator to digital values.
 */

#ifndef CONVERTER_H_
#define CONVERTER_H_

#include <stdint.h>   /* for uintptr_t */
#include "types.h"

// Constants
#define PORT_LENGTH	(0x01)

// Intialize the A/D input register to capture analog data.
//--------------------------------------------------------------       
void InitADRegister(void);

// Perform an A/D conversion to get a digital value from the 
// input signal.
//--------------------------------------------------------------       
void PerformADConversion(void);

// Retrieve the 16-bit A/D value.
//--------------------------------------------------------------       
INT16 ReadADData(void);

// Convert a 16-bit A/D value to a digital voltage level.
//--------------------------------------------------------------       
float ConvertADData(INT16);

#endif /* CONVERTER_H_ */
